<template>
<<<<<<< HEAD
<div class="HomeSwiper">
<van-search v-model="searchValue" placeholder="请输入搜索关键词" />
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  <van-swipe-item>1</van-swipe-item>
  <van-swipe-item>2</van-swipe-item>
  <van-swipe-item>3</van-swipe-item>
  <van-swipe-item>4</van-swipe-item>
</van-swipe>
</div>
</template>
<script>
export default{
 data() {
    return {
      searchValue: '薛之谦',
    };
  },
}
</script>
<style scoped>
  .my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
  }
=======
    <div class="homeswiper">
      <van-search v-model="value" placeholder="请输入搜索关键词" />
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="item in bannerData" :key="item.id">
      <img :src="item.picUrl" alt="">
    </van-swipe-item>
    <!-- <van-swipe-item>2</van-swipe-item>
    <van-swipe-item>3</van-swipe-item>
    <van-swipe-item>4</van-swipe-item> -->
    </van-swipe>
    </div>
</template>
<script>
import axios from 'axios'
export default {
    data() {
    return {
      value: '薛之谦',
      bannerData:[]
    };
  },
  // created(){
  //   this.getBanner()//针对异步，否则无法正常获取dom结点
  // },
  methods:{
    getBanner(){//名字可以随便取
    //axios.get("").then().catch()安装插件axios spnnier
      axios.get("/api/recommend/banner")
      .then(res => {
        console.log(res.data.data)
        this.bannerData=res.data.data
      })
      .catch(err => {
        console.error(err); 
      })
    }
  },
  mounted(){
    this.getBanner()//不需要管同步异步
  }
}
</script>
<style scoped>
    .my-swipe .van-swipe-item{
    color: #fff;
    font-size: 20px;
    line-height: 33px;
    text-align: center;
    /* background-color: #39a9ed; */
  }
  .my-swipe .van-swipe-item img{
    width: 90%;
    border-radius: 20px;
  } 
>>>>>>> fcad0db (图片文字)
</style>